package com.atguigu.day11.ploy.p2;

public class TestArg {
    public static void main(String[] args) {

        Dog d = new Dog();
        Cat c = new Cat();
        Monkey m = new Monkey();

        showEat(d);
        showEat(c);
        showEat(m);
    }

    // Animal d = new Cat();
    //todo 父类类型做形参 可以接收任意子类对象
    public static void showEat(Animal d) {
        d.eat();
    }
   /* public static void showEat(Dog  d){
        d.eat();
    }
    public static void showEat(Cat c){
        c.eat();
    }
    public static void showEat(Monkey m){
        m.eat();
    }*/
}
